<include file="Public/min-header"/>
<style>
.picture {
    line-height: 0;
    background-color: #FFF;
    text-align: center;
    vertical-align: middle;
    display: table-cell; 
    width: 160px;
    height: 100px;
    margin: 0 auto;
    border: solid 1px #F5F5F5;
    overflow: hidden;
}
.picture img {
    max-width: 160px;
    max-height: 100px;
    margin-top: expression(100-this.height/2);
}
</style>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content" style="padding:0px 15px;">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
                <a onclick="get_help(this)" data-url="#" class="btn btn-default" href="javascript:;"><i class="fa fa-question-circle"></i> 帮助</a>                
            </div>
            <div class="panel panel-default">           
                <div class="panel-body ">   
					<include file="store_setting_navtabs"/>
                    <!--表单数据-->
                    <form method="post" id="handlepost">
                    <!--通用信息-->
                    <div class="tab-pane margin" id="tab_info">
				        <div class="panel panel-default">
				            <div class="panel-heading">
				                <h3 class="panel-title">公司及联系人信息</h3>
				            </div>
				            <div class="panel-body">
				                <table class="table table-bordered">
				                    <tbody>
				                    <tr>
				                        <td>公司名称</td><td><input name="company_name" value="{$apply.company_name}" class="form-control"></td>
				                        <td>公司网址:</td><td colspan="3"><input name="company_website" value="{$apply.company_website}" class="form-control" placeholder="www.xxx.com"></td>
				                    </tr>
				                    <tr><td>公司所在地:</td>
				                        <td colspan="3"><input name="company_address" value="{$apply.company_address}" class="form-control"></td>
				                        <td>固定电话</td><td><input name="company_telephone" value="{$apply.company_telephone}" class="form-control"></td>
				                    </tr>
				                    <tr><td>邮政编码:</td><td><input name="company_zipcode" value="{$apply.company_zipcode}" class="form-control"></td>
				                        <td>电子邮箱:</td><td><input name="company_email" value="{$apply.company_email}" class="form-control"></td>
				                        <td>传真:</td><td><input name="company_fax" value="{$apply.company_fax}" class="form-control"></td>
				                    </tr>
				                    <tr>
				                        <td>联系人姓名:</td><td><input name="contacts_name" value="{$apply.contacts_name}" class="form-control"></td>
				                        <td>联系人电话:</td><td><input name="contacts_mobile" value="{$apply.contacts_mobile}" class="form-control"></td>
				                        <td>联系人邮箱:</td><td><input name="contacts_email" value="{$apply.contacts_email}" class="form-control"></td>
				                    </tr>
				                    </tbody>
				                </table>
				            </div>
				        </div>
				        <!--新订单列表 收货人信息-->
				        <div class="panel panel-default">
				            <div class="panel-heading">
				                <h3 class="panel-title">营业执照信息（副本）</h3>
				            </div>
				            <div class="panel-body">
				                <table class="table table-bordered">
				                    <tbody>
				                    <tr>
										<td>营业执照号:</td><td><input name="business_licence_number" value="{$apply.business_licence_number}" class="form-control"></td>
										<td>营业执照有效期:</td><td><input name="business_date_end" value="{$apply.business_date_end}" class="form-control"></td>
										<td>法定经营范围:</td>
										<td><textarea rows="3" cols="40" name="business_scope" class="form-control">{$apply.business_scope}</textarea></td>
				                    </tr>
				                    <tr>
				   					<td>注册资本:</td><td><input name="reg_capital" value="{$apply.reg_capital}" class="form-control"></td>
									<td>组织机构代码:</td><td><input name="orgnization_code" value="{$apply.orgnization_code}" class="form-control"></td>
							 		<td>一般纳税人证明:</td><td>{$apply.taxpayer_cert}</td>
				                    </tr>
				                    <tr>
				   					<td>法人代表姓名:</td><td><input name="legal_person" value="{$apply.legal_person}" class="form-control"></td>
									<td>纳税类型码:</td>
									<td>{$apply.tax_rate}</td>
							 		<td>税务登记号码:</td><td><input name="attached_tax_number" value="{$apply.attached_tax_number}" class="form-control"></td>
				                    </tr>
				                    </tbody>
				                </table>
				            </div>
				        </div>
				        <!--新订单列表 商品信息-->
<!-- 				        <div class="panel panel-default">
				            <div class="panel-heading">
				                <h3 class="panel-title">结算账号信息 </h3>
				            </div>
				            <div class="panel-body">
				                <table class="table table-bordered">
				                    <thead>
				                    <tr>
				                        <td class="text-left">银行开户名</td>
				                        <td class="text-left">公司银行账号：</td>
				                        <td class="text-right">开户银行支行名称：</td>
				                        <td class="text-right">支行联行号：</td>
				                        <td class="text-right">开户银行所在地：</td>
				                    </tr>
				                    </thead>
				                    <tbody>
				                        <tr>
				                            <td class="text-left"><input name="bank_account_number" value="{$apply.bank_account_name}" class="form-control"></td>
				                            <td class="text-left"><input name="bank_account_name" value="{$apply.bank_account_number}" class="form-control"></td>
				                            <td class="text-right"><input name="bank_branch_name" value="{$apply.bank_branch_name}" class="form-control"></td>
				                            <td class="text-right"><input name="bank_province" value="{$apply.bank_province}" class="form-control"></td>
				                            <td class="text-right"><input name="bank_city" value="{$apply.bank_city}" class="form-control"></td>
				                        </tr>
				                    </tbody>
				                </table>
				            </div>
				        </div> -->
				        <!--新订单列表 费用信息-->
				        <div class="panel panel-default">
				            <div class="panel-heading">
				                <h3 class="panel-title">店铺负责人信息</h3>
				            </div>
				            <div class="panel-body">
				                <table class="table table-bordered">
				                    <tbody>
				         				<tr>
				                         <td class="text-left">店铺负责人:</td><td><input name="store_person_name" value="{$apply.store_person_name}" class="form-control"></td>
				                         <td class="text-left">负责人手机号码:</td><td><input name="store_person_mobile" value="{$apply.store_person_mobile}" class="form-control"></td>
				                    	</tr>
				                    	<tr>			                        				                         
				                         <td class="text-left">负责人QQ号码:</td><td><input name="store_person_qq" value="{$apply.store_person_qq}" class="form-control"></td>
				                    	 <td class="text-left">负责人邮箱：</td><td><input type="text" name="store_person_email" value="{$apply.store_person_email}" class="form-control"></td>
				                    	</tr>
				                    </tbody>
				                </table>
				
				            </div>
				        </div>
				        <div class="panel panel-default">
				            <div class="panel-heading">
				                <h3 class="panel-title">证件信息</h3>
				            </div>
				            <div class="panel-body">
				                <table class="table table-bordered">
				                    <thead>
				                    <tr>
				                        <td class="text-left">企业营业执照副本：</td>
				                        <td class="text-left">税务登记证复印件：</td>
				                        <td class="text-right">织机构代码证复印件：</td>
				                        <td class="text-right">法人身份证：</td>
				                        <td class="text-right">店铺负责人身份证：</td>
				                    </tr>
				                    </thead>
				                    <tbody>
				                        <tr>
				                            <td>
				                            	<div class="text-center">
				                            		<a href="{$apply.business_licence_cert}" target="_blank">
													<if condition="$apply[business_licence_cert] eq ''">
				                            			<img id="business_licence_cert" src="__PUBLIC__/images/not_adv.jpg" height="120">
				                            		<else/>
				                            			<img id="business_licence_cert" src="{$apply.business_licence_cert}" height="120">
				                            		</if>
				                            		</a>
				                            	</div>
												<?php
												//if($store['store_state']==0){
												?>
				                            	<div class="text-center">
				                            		<input type="hidden" name="business_licence_cert" value="{$apply.business_licence_cert}">
				                            		<input type="button" class="btn btn-default" onClick="upload_img('business_licence_cert')"  value="上传图片"/>
				                            	</div>
												<?php
												//}
												?>
				                            </td>
              				                <td>
				                            	<div class="text-center">
				                            		<a href="{$apply.taxpayer_cert}" target="_blank">
				                            		<if condition="$apply[taxpayer_cert] eq ''">
				                            			<img id="taxpayer_cert" src="__PUBLIC__/images/not_adv.jpg" height="120">
				                            		<else/>
				                            			<img id="taxpayer_cert" src="{$apply.taxpayer_cert}" height="120">
				                            		</if>
				                            		</a>
				                            	</div>
												<?php
												//if($store['store_state']==0){
												?>
				                            	<div class="text-center">
				                            		<input type="hidden" name="taxpayer_cert" value="{$apply.taxpayer_cert}">
				                            		<input type="button" class="btn btn-default" onClick="upload_img('taxpayer_cert')"  value="上传图片"/>
				                            	</div>
												<?php
												//}
												?>
				                            </td>
				                            <td>
				                            	<div class="text-center">
				                            		<a href="{$apply.orgnization_cert}" target="_blank">
				                            		<if condition="$apply[orgnization_cert] eq ''">
				                            			<img id="orgnization_cert" src="__PUBLIC__/images/not_adv.jpg" height="120">
				                            		<else/>
				                            			<img id="orgnization_cert" src="{$apply.orgnization_cert}" height="120">
				                            		</if>
				                            		</a>
				                            	</div>
												<?php
												//if($store['store_state']==0){
												?>
				                            	<div class="text-center">
				                            		<input type="hidden" name="orgnization_cert" value="{$apply.orgnization_cert}">
				                            		<input type="button" class="btn btn-default" onClick="upload_img('orgnization_cert')"  value="上传图片"/>
				                            	</div>
												<?php
												//}
												?>
				                            </td>
				                            <td>
				                            	<div class="text-center">
				                            		<a href="{$apply.legal_identity_cert}" target="_blank">
				                            		<if condition="$apply[legal_identity_cert] eq ''">
				                            			<img id="legal_identity_cert" src="__PUBLIC__/images/not_adv.jpg" height="120">
				                            		<else/>
				                            			<img id="legal_identity_cert" src="{$apply.legal_identity_cert}" height="120">
				                            		</if>
				                            		</a>
				                            	</div>
												<?php
												//if($store['store_state']==0){
												?>
				                            	<div class="text-center">
				                            		<input type="hidden" name="legal_identity_cert" value="{$apply.legal_identity_cert}">
				                            		<input type="button" class="btn btn-default" onClick="upload_img('legal_identity_cert')"  value="上传图片"/>
				                            	</div>
												<?php
												//}
												?>
				                            </td>
				                            <td>
				                            	<div class="text-center">
				                            		<a href="{$apply.store_person_cert}" target="_blank">
				                            		<if condition="$apply[store_person_cert] eq ''">
				                            			<img id="store_person_cert" src="__PUBLIC__/images/not_adv.jpg" height="120">
				                            		<else/>
				                            			<img id="store_person_cert" src="{$apply.store_person_cert}" height="120">
				                            		</if>
				                            		</a>
				                            	</div>
												<?php
												//if($store['store_state']==0){
												?>
				                            	<div class="text-center">
				                            		<input type="hidden" name="store_person_cert" value="{$apply.store_person_cert}">
				                            		<input type="button" class="btn btn-default" onClick="upload_img('store_person_cert')"  value="上传图片"/>
				                            	</div>
												<?php
												//}
												?>
				                            </td>
				                        </tr>
				                    </tbody>
				                </table>
				            </div>
				        </div>
                        </div>
			    	<div class="pull-right">
			    	    <input type="hidden" name="store_id" value="{$store.store_id}">
						<input type="hidden" name="store[user_id]" value="{$store.user_id}">
						<?php
						//if($store['store_state']==0){
						?>
			    	    <button class="btn btn-primary" onclick="actsubmit()" title="" type="button">保存</button>
						<?php
						//}
						?>
			    	</div>
					</form><!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>

<script>
$(document).ready(function(){
	$('.btn-flat').click(function(){
		if(!$(this).hasClass('btn-info')){
			$(this).removeClass('btn-default');
			$(this).addClass('btn-info');
			$(this).siblings().addClass('btn-default');
			$(this).siblings().removeClass('btn-info');
			$('#'+$(this).attr('data-id')).val($(this).attr('rel'));
		}
	})
})


var flag = true;
function actsubmit(){
	if($('input[name=store_name]').val() == ''){
		layer.msg("店铺名称不能为空", {icon: 2,time: 2000});
		return;
	}
	if(flag){
		$('#handlepost').submit();
	}else{
		layer.msg("请检查店铺名称和卖家账号", {icon: 2,time: 2000});
	}
}

var tmp_type = '';
function upload_img(cert_type){
	tmp_type = cert_type;
	GetUploadify(1,'store','cert','callback');
}
function goset(obj){
	window.location.href = $(obj).attr('data-url');
}
function callback(img_str){
	$('#'+tmp_type).attr('src',img_str);
	$('input[name='+tmp_type+']').val(img_str);
}
</script>
</body>
</html>